import { handleActions } from 'redux-actions'
import { success } from '../ui-components'

const init = {
  userProfile: {},
	coreProfile: {}
}

export default handleActions({
  'fetch onboarding profile': (state, { payload }) => ({
    ...state,
    userProfile: payload
  }),
  'update onboarding profile': (state, { payload }) => ({
    ...state,
    userProfile: {
      ...state.userProfile,
      ...payload
    }
  }),
	'fetch onboarding core profile': (state, { payload }) => ({
		...state,
		coreProfile: payload
	}),
  'reset onboarding staff': (state) => ({
    ...state,
    ...init
  })
}, init)
